var defaultFont = "terminus,12,-1,5,50,0,0,0,0,0",
	defaultBoldFont = "terminus,12,-1,5,75,0,0,0,0,0",
	ligthBlack = "#181818",
	ligthOrange = "#ff9c00",
	darkOrange = "#af5f24",
	darkWhite = "#f5f5f5",
	gray = "#5f5f5f";

var cppLexer = lexerFactory.lexer("*cpp;*.h");
var CppStyles = {
	Default:                0,
	Comment:                1,
	CommentLine:            2,
	CommentDoc:             3,
	Number:                 4,
	Keyword:                5,
	DoubleQuotedString:     6,
	SingleQuotedString:     7,
	UUID:                   8, // unused
	PreProcessor:           9,
	Operator:               10,
	Identifier:             11,
	UnclosedString:         12,
	VerbatimString:         13,
	Regex:                  14,
	CommentLineDoc:         15,
	KeywordSet2:            16,
	CommentDocKeyword:      17,
	CommentDocKeywordError: 18,
	GlobalClass:            19
};

cppLexer.styles =
	"Default, Comment, CommentLine, CommentDoc, Number, Keywords, DoubleQuotedString, \
	SingleQuotedString, UUID, PreProcessor, Operators, Identifier, UnclosedString, VerbatimString, \
	Regex, CommentLineDoc, KeywordSet2, CommentDocKeyword, CommentDocKeywordError, GlobalClass";

cppLexer.language = "C++";
cppLexer.lexer = "cpp";
cppLexer.autoCompletionWordSeparators = "::, ->, .";
// cppLexer.blockLookback = 20;
cppLexer.braceStyle = CppStyles.Operator;
cppLexer.caseSensitive = 1;
cppLexer.defaultStyle = CppStyles.Default;
cppLexer.wordCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#";
cppLexer.blockEndStyle = CppStyles.Operator;
cppLexer.blockStartStyle = CppStyles.Operator;
cppLexer.blockStartKeywordStyle = CppStyles.Keywords;
cppLexer.blockEndString = "}";
cppLexer.blockStartString = "{";
cppLexer.blockStartKeywordString = "case catch class default do else finally for if private protected public struct try union while";
cppLexer.defaultColor = darkWhite;
cppLexer.defaultPaper = ligthBlack;
cppLexer.defaultFont = defaultFont;
// cppLexer.defaultEolFill = 0;
// cppLexer.autoIndentStyle = 0;

// Style settings
cppLexer.Default = { fore: "#ff0000" };
cppLexer.Comment = { fore: gray };
cppLexer.CommentLine = { fore: gray };
cppLexer.CommentDoc = { fore: gray };
cppLexer.Number = { fore: ligthOrange };
cppLexer.Keywords = { fore: darkOrange, font: defaultBoldFont };
cppLexer.DoubleQuotedString = { fore: ligthOrange };
cppLexer.SingleQuotedString = { fore: ligthOrange };
cppLexer.PreProcessor = { fore: darkWhite, back: gray, eolFill: 1 };
cppLexer.Operators = { fore: darkOrange, font: defaultBoldFont };
cppLexer.Identifier = { fore: darkWhite };
cppLexer.UnclosedString = { fore: ligthBlack, back: ligthOrange, eolFill: 1 };
cppLexer.VerbatimString = { fore: ligthBlack };

cppLexer.keywords1 = "and and_eq asm auto bitand bitor bool break case catch char class compl const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new not not_eq operator or or_eq private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while xor xor_eq";
cppLexer.keywords2 = "QString";
cppLexer.keywords3 = "a addindex addtogroup anchor arg attention author b brief bug c class code date def defgroup deprecated dontinclude e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception f$ f[ f] file fn hideinitializer htmlinclude htmlonly if image include ingroup internal invariant interface latexonly li line link mainpage name namespace nosubgrouping note overload p page par param post pre ref relates remarks return retval sa section see showinitializer since skip skipline struct subsection test throw todo typedef union until var verbatim verbinclude version warning weakgroup $ @ \\ & < > # { }";

cppLexer["properties.fold.comment"]=1;
cppLexer["properties.fold.compact"]=1;
cppLexer["properties.fold.preprocessor"]=1;
cppLexer["properties.style.within.preprocessor"]=1;

lexerFactory.applySettings(cppLexer);
